package com.tongji.showroom.model
{ 
	import com.adobe.serialization.json.JSON;
	import com.tongji.showroom.vo.SceneAngle;
	
	import mx.collections.ArrayCollection;
	import mx.controls.Image;
	
	import org.robotlegs.mvcs.Actor;
	
	/**
	 * 
	 * @author jiarong
	 * 
	 */
	[Bindable]
	public class SearchSceneModel extends Actor
	{
		public var scene:String;
		public var sceneArr:ArrayCollection;
		public var SearchSceneArr:ArrayCollection;
		public var checkBoxArr1:ArrayCollection = new ArrayCollection();
		public var checkBoxArr2:ArrayCollection = new ArrayCollection();
		public var pageNum:Number;                                   //xuhao  页数
		public var pageArr:ArrayCollection = new ArrayCollection(); //xuhao  创建存放每一页的数组
		public var curPage:int;                              	     //xuhao  前页中间按钮的页数
		public var leftCurPage:int;                   				//xuhao  前页左边按钮的页数
		public var rightCurPage:int;                  				//xuhao  前页右边按钮的页数
		public var tempSceneArray:ArrayCollection; //czy
		public var selectSceneArray:ArrayCollection = new ArrayCollection();
		
		public var sceneArray:ArrayCollection = new ArrayCollection();//存储场景信息
		public var tempImage:Image = new Image();
		
		//public var scene:String;
		public var sceneCollection:ArrayCollection;
		
		public function SearchSceneModel()
		{
			super();
		}
		/*
		public function updateSelectedScene(selectSceneArray:ArrayCollection):void
		{
			this.selectSceneArray = selectSceneArray;
		}*/
		
		public function updateScenes(scene:String):void
		{
			pageArr.removeAll();
			this.scene = scene;
			var arr:Array = (JSON.decode(scene) as Array);
			sceneArr = new ArrayCollection(arr);
			SearchSceneArr = new ArrayCollection(sceneArr[0].VR_SceneList);	
		}
		
		/*public function getScenes(scene:String):void
		{
			pageArr.removeAll();
			this.scene = scene;
			var arr:Array = (JSON.decode(scene) as Array);
			sceneArr = new ArrayCollection(arr);
			SearchSceneArr = new ArrayCollection(sceneArr[0].VR_SceneList);
			
			//计算页数
			if (sceneArr[0].PageCount % 9 == 0)
			{
				pageNum = sceneArr[0].PageCount / 9;
			}
			else
			{
				pageNum = int(sceneArr[0].PageCount / 9) + 1;
			}
			//初始化按钮所指的页数
			if (pageNum == 1)
			{
				leftCurPage = 1;
			}			
			if (pageNum == 2)
			{
				leftCurPage = 1;
				curPage = 2;
			}
			if (pageNum >= 3)
			{
				leftCurPage = 1;
				curPage = 2;
				rightCurPage = 3;
			}
			
			for (var i:int = 0; i < pageNum; i++)
			{
				pageArr.addItem(i + 1);			
			}		
		}*/
	}
}